<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<meta name="viewport" id="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="format-detection" content="telephone=no"/>
<link href="css/reset.css" rel="stylesheet" type="text/css">
<link href="css/discounts.css" rel="stylesheet" type="text/css">
</head>
<body>
<div class="near-box">
      <!--头部开始-->
	  <div class="header"  id="headerTxt">
	  	 <a href="index.html" class="left"></a>

	  </div>
	  <!--头部结束-->
      <div class="discounts-bigbox">
		  <div class="discounts-banner1"><img src="del/discounts-img1.jpg" alt=""></div>

      </div>
      <!--bigbox结束-->
      <div class="discounts-bottom">
      	 <div class="d-bottom-img1"><i>1</i></div>
      	 <span class="d-bottom-text1">￥10</span>
      	 <a href="" class="d-bottom-text2">去结算</a>
      </div>
      
</div>
<script type="text/javascript" src="js/scrolltopcontrol.js"></script>
<script type="text/javascript" src="js/core.util.js"></script>
<script type="text/javascript" src="js/mlayer.min.js"></script>
<script src="js/jquery-1.8.3.min.js"></script>
<script>
$(function(){
	var url=window.location.search; //获取url中"?"符后的字串
	var catId = url.substr(url.indexOf("=")+1);
	if(catId == 30) {
		$("#headerTxt").append("果篮礼盒");
	} else if(catId == 28) {
		$("#headerTxt").append("干果果汁");
	} else if(catId == 25) {
		$("#headerTxt").append("西瓜蜜瓜");
	} else if(catId == 26) {
		$("#headerTxt").append("葡提浆果");
	}
	var index = mlayer.loading({
		title: '加载中'
	});
	CoreUtil.sendPost("/api/index/getProductByCateId", {"catId":catId},function (res) {
		if(res.code ==  200) {
			var content = "";
			for(var imvos of res.data.productVoList) {
				content+="<div class='discounts-box1'>";
					content+="<a href='goods-details.html?productId="+imvos.id+"'><span class='d-box1-img1'><img src='"+imvos.imgUrl+"' alt=''></span></a>";
						content+="<div class='discounts-box2'>";
							content+="<span class='d-box2-text1'>"+imvos.productName+"</span>";
							content+="<span class='d-box2-text2'>￥"+imvos.mallMobilePrice+" </span>";
						content+="<button class='d-box2-btn'>立即购买</button>";
					content+="</div>";
				content+="</div>";
			}
			$(".discounts-banner1").append(content)
		} else {
			mlayer.error({
				title: res.msg,
				time: 3
			});
		}
		mlayer.close(index);
	});
});
</script>
</body>
</html>